package com.rdxy.mult.controller;

import com.rdxy.common.vo.Result;
import com.rdxy.mult.entity.Category;
import com.rdxy.mult.service.ICategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 人道逍遥
 * @since 2023-06-02
 */
@RestController
@RequestMapping("/category")
public class CategoryController {

    @Autowired
    private ICategoryService categoryService;

    @GetMapping("/list")
    public Result<?> getCategoryList(){

        List<Category> list = categoryService.list();
        for (Category category : list) {
            System.out.println(category);
        }

        return Result.success(list);

    }

}
